//-----------------------------------------------------------------------
// <copyright file="tblCurrencyInOpicService.cs" company="Cyvee">
//     Copyright ? Cyvee. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using Scb.Framework;
using Robot.Entities;
using Robot.Data;
    
namespace Robot.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class tblCurrencyInOpicService
    {
      #region My Store Procedure

      public static tblCurrencyInOpic GettblCurrencyInOpicByCCY(string sBuyCCY, string sSellCCY)
      {
        try
        {
          tblCurrencyInOpicDAO tblCurrencyInOpicDAO = new tblCurrencyInOpicDAO();
          return tblCurrencyInOpicDAO.GettblCurrencyInOpicByCCY(sBuyCCY, sSellCCY);
        }
        catch (BusinessException)
        {
          throw;
        }
        catch (Exception ex)
        {
          // log this exception
          Logger.Error(ex);
          // wrap it and rethrow
          throw new BusinessException(SR.BusinessGettblCurrencyInOpicException, ex);
        }
      } 

      #endregion

      #region tblCurrencyInOpic

      public static void CreatetblCurrencyInOpic(tblCurrencyInOpic tblCurrencyInOpic)
        {            
            try
            {
                tblCurrencyInOpicDAO tblCurrencyInOpicDAO = new tblCurrencyInOpicDAO();
                tblCurrencyInOpicDAO.CreatetblCurrencyInOpic(tblCurrencyInOpic);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreatetblCurrencyInOpicException, ex);
            }
        }        

        public static void UpdatetblCurrencyInOpic(tblCurrencyInOpic tblCurrencyInOpic)
        {            
            try
            {
                tblCurrencyInOpicDAO tblCurrencyInOpicDAO = new tblCurrencyInOpicDAO();
                tblCurrencyInOpicDAO.UpdatetblCurrencyInOpic(tblCurrencyInOpic);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdatetblCurrencyInOpicException, ex);
            }
        }        

        public static void DeletetblCurrencyInOpic(int id)
        {            
            try
            {
                tblCurrencyInOpicDAO tblCurrencyInOpicDAO = new tblCurrencyInOpicDAO();
                tblCurrencyInOpicDAO.DeletetblCurrencyInOpic(id);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeletetblCurrencyInOpicException, ex);
            }
        }
        
        public static tblCurrencyInOpic GettblCurrencyInOpic(int id)
        {            
            try
            {
                tblCurrencyInOpicDAO tblCurrencyInOpicDAO = new tblCurrencyInOpicDAO();
                return tblCurrencyInOpicDAO.GettblCurrencyInOpic(id);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblCurrencyInOpicException, ex);
            }
        }                

        public static tblCurrencyInOpicCollection GettblCurrencyInOpicList(tblCurrencyInOpicColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                tblCurrencyInOpicDAO tblCurrencyInOpicDAO = new tblCurrencyInOpicDAO();
                return tblCurrencyInOpicDAO.GettblCurrencyInOpicList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblCurrencyInOpicListException, ex);
            }
        }        

        public static tblCurrencyInOpicCollection GettblCurrencyInOpicList(tblCurrencyInOpicColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                tblCurrencyInOpicDAO tblCurrencyInOpicDAO = new tblCurrencyInOpicDAO();
                return tblCurrencyInOpicDAO.GettblCurrencyInOpicList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGettblCurrencyInOpicListException, ex);
            }
        }

      
        #endregion
    }
}